/*
 * rt_setRoute.cpp
 *
 *  Created on: Dec 22, 2013
 *      Author: m
 */

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include "RoutingTable.h"

int main ( int argc, char* argv[] )
{
    int rmqId;
    int brokerId;

    if ( argc != 3 )
    {
        std::cerr << "Cantidad de argumentos invalidos." << std::endl;
        std::cerr << "Uso: ." << argv[0] << " [rmqID] [brokerID]" << std::endl;
        exit( 1 );
    }

    /*
     * Save values of command line arguments
     */
    sscanf( argv[1], "%d", &rmqId );
    sscanf( argv[2], "%d", &brokerId );

    RoutingTable::setRoute( rmqId, brokerId );

    std::cout << "The route for rmqID: " << rmqId << " was successfully updated to: " << brokerId << std::endl;

    return 0;
}
